export default function(){
    function compare(){

    }
    $.extend(compare.prototype,{
        init : function(list , id){
            var arr = [];
            $.each(list,function(index,item){
                if(item.goods_id == id){
                    arr.push(item);
                }
            })
            var html  = "";
            var text  = "";
            var title = "";
            var promotion = "";
            var price  = "";
            var choose = "";
            var size  = "";
            var addr  = "";
            var lazy  = "";
            $.each(arr,function(index,item){
                html += `<li class="cur" big-src="${item.big_pic_1}">
                            <a href="javascript:;"><img src="${item.left_pic_1}"></a>
                        </li>
                        <li class="" big-src="${item.big_pic_2}">
                            <a href="javascript:;"><img src="${item.left_pic_2}"></a>
                        </li>
                        <li class="" big-src="${item.big_pic_3}">
                            <a href="javascript:;"><img src="${item.left_pic_3}"></a>
                        </li>
                        <li class="" big-src="${item.big_pic_4}">
                            <a href="javascript:;"><img src="${item.left_pic_4}"></a>
                        </li>
                        <li class="mr0" big-src="${item.big_pic_5}">
                            <a href="javascript:;"><img src="${item.left_pic_5}"></a>
                        </li>` ;
                text  += `<img src="${item.big_pic_1}">`;
                title +=`${item.title}`;
                promotion += `<div class="brand-tag-red fl">${item.tips}</div>
            <div class="info">${item.m}<a class="detail" href="//shop.juanpi.com/factivity/3460234" target="_blank">详情<span class="act_detail_icon"></span></a></div>`;
                price +=`<span class="current-p fl ">
                            <i class="symbols">￥</i><span class="js-cprice">${item.cprice}</span>
                        </span>
                        <span class="old">参考价: <em class="u-yen">¥</em><span class="js-oprice">${item.oprice}</span></span>
                        `;
                 choose +=`<div class="attr_pic" data-c="1">
                            <a title="${item.sku.ss_av_zvalue_1}">
                                <img src="${item.sku.ss_av_zpic_1}" alt="">
                                <span class="attr_title">${item.sku.ss_av_zvalue_1}</span>
                            </a>
                        </div>
                        <div class="attr_pic" data-c="1">
                            <a title="${item.sku.ss_av_zvalue_2}">
                                <img src="${item.sku.ss_av_zpic_2}" alt="">
                                <span class="attr_title">${item.sku.ss_av_zvalue_2}</span>
                            </a>
                        </div>
                        <div class="attr_pic" data-c="1">
                            <a title="${item.sku.ss_av_zvalue_3}">
                                <img src="${item.sku.ss_av_zpic_3}" alt="">
                                <span class="attr_title">${item.sku.ss_av_zvalue_3}</span>
                            </a>
                        </div>`;
                    size+=`
                    <span>尺码 :</span>
                    <div class="size-wrap">
                        <div class="nos">
                            <a href="javascript:void(0)"><span class="c">${item.sku.ss_av_fvalue_1}</span></a>
                        </div>
                    </div>
                    <div class="size-wrap">
                        <div class="nos">
                            <a href="javascript:void(0)"><span class="c">${item.sku.ss_av_fvalue_2}</span></a>
                        </div>
                    </div>
                    <div class="size-wrap">
                        <div class="nos">
                            <a href="javascript:void(0)"><span class="c">${item.sku.ss_av_fvalue_3}</span></a>
                        </div>  
                    </div>
                    <div class="size-wrap">
                        <div class="nos">
                            <a href="javascript:void(0)"><span class="c">${item.sku.ss_av_fvalue_4}</span></a>
                        </div>  
                    </div>
                    <div class="size-wrap">
                        <div class="nos">
                            <a href="javascript:void(0)"><span class="c">${item.sku.ss_av_fvalue_5}</span></a>
                        </div>  
                    </div>
                        `;       
                addr += `
                <a href="//www.juanpi.com" class="tab-links">首页</a>
                <em class="tab_arrow"></em>
                <a href="//brand.juanpi.com/${item.address}" class="tab-links">${item.type}</a>
                <em class="tab_arrow"></em>
                <a class="bady-xx-seo tab-links" href="//shop.juanpi.com/deal/174313455">${item.title}</a>
                `
                lazy +=`<div class="info-title">
                            <span class="single-style">整体款式</span>
                        </div>
                        <div class="details-info">
                            <div class="goods_desc_e">
                                <img class="goods_desc_img lazy" d-src= ${item.lazy_pic_1} src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_2}" src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_3}" src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_4}" src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_5}" src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_6}" src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_7}" src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                            </div>                        
                        </div>                        
                        <div class="info-title" _tagname="模特实拍">
                            <span class="single-style">模特实拍</span>
                        </div>
                        <div class="details-info">
                            <div class="goods_desc">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_8}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_9}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_10}" src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_11}" src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                            </div>                      
                        </div>
                        <div class="info-title" _tagname="细节做工">
                            <span class="single-style">细节做工</span>
                        </div>
                        <div class="details-info">
                            <div class="goods_desc">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_12}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_13}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_14}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_15}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_16}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_17}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_18}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_19}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                                <img class="goods_desc_img lazy" d-src="${item.lazy_pic_20}"  src="http://jp.juancdn.com/juanpi/images/list/loading.gif?ts=20181022174388-1&sv=449ce9ee" style="display: block;">
                            </div>                      
                        </div>`
            })
            return {
                html ,
                text,
                title,
                promotion,
                price,
                choose,
                size,
                addr,
                lazy
            };
        }
    })
    return new compare();
}